import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
const history = createWebHistory();
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/first",
  },
  {
    path: "/home",
    name: "home",
    component: () => import("../views/home/index.vue"),
    children: [
      {
        path: "/first",
        name: "first",
        component: () => import("../views/footer/first.vue"),
      },
      {
        path: "/my",
        name: "my",
        component: () => import("../views/footer/my.vue"),
      },
      {
        path: "/order",
        name: "order",
        component: () => import("../views/footer/order.vue"),
      },
      // 登录
      {
        path: "/login",
        name: "login",
        component: () => import("../views/SinglePage/login.vue"),
      },
      // 注册
      {
        path: "/register",
        name: "register",
        component: () => import("../views/SinglePage/register.vue"),
      },
    ],
  },
  // 咨询页面
  {
    path: "/consult",
    name: "consult",
    component: () => import("../views/SinglePage/consult.vue"),
  },
  {
    path: "/service",
    name: "service",
    component: () => import("../views/footer/service.vue"),
  },
  // 城市页面
  {
    path: "/site",
    name: "site",
    component: () => import("../views/SinglePage/site.vue"),
  },
  // 城市页面
  {
    path: "/sites",
    name: "sites",
    component: () => import("../views/SinglePage/sites.vue"),
  },
  // 订单详情页面
  {
    path: "/particulars",
    name: "particulars",
    component: () => import("../views/SinglePage/particulars.vue"),
  },
  // 乘客页面
  {
    path: "/passenger",
    name: "passenger",
    component: () => import("../views/SinglePage/passenger.vue"),
  },
  // 车票页面
  {
    path: "/query",
    name: "query",
    component: () => import("../views/SinglePage/query.vue"),
  },
  // 车票页面
  {
    path: "/moment",
    name: "moment",
    component: () => import("../views/SinglePage/moment.vue"),
  },
  // 订票页面
  {
    path: "/reserve",
    name: "reserve",
    component: () => import("../views/SinglePage/reserve.vue"),
  },
  // 订单页面
  {
    path: "/submitOrder",
    name: "submitOrder",
    component: () => import("../views/SinglePage/submitOrder.vue"),
  },
];
const router = createRouter({
  history,
  routes,
});
export default router;
